import Vue from 'vue'
import VueRouter from 'vue-router'

import Layout from '@/layout'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/login',
      component: () => import('@/views/Login/index'),
      hidden: true
    },
    {
      // 新增月卡管理页
      path: '/cardAdd',
      component: () => import('@/views/Car/monthCard/add-card'),
      hidden: true
    },
    {
      path: '/',
      component: Layout,
      redirect: '/workbench',
      children: [{
        path: '/workbench',
        name: 'workbench',
        component: () => import('@/views/Workbench/index'),
        meta: { title: '工作台', icon: 'el-icon-eleme' }
      }]
    },
    {
      path: '/park',
      component: Layout,
      name: 'park',
      meta: { title: '园区管理', icon: 'el-icon-office-building' },
      children: [{
        path: '/building',
        name: 'building',
        meta: { title: '楼宇管理' },
        component: () => import('@/views/park/building/index')
      },
      {
        path: '/enterprise',
        name: 'enterprise',
        meta: { title: '企业管理' },
        component: () => import('@/views/park/enterprise/index')
      },
      {
        path: '/enterpriseAdd',
        name: 'enterpriseAdd',
        component: () => import('@/views/park/enterprise/add.vue')
      },
      {
        path: '/exterpriseDetail',
        name: 'exterpriseDetail',
        component: () => import('@/views/park/enterprise/detail.vue')
      }
      ]
    },
    {
      path: '/Car',
      component: Layout,
      name: 'car',
      meta: { title: '行车管理', icon: 'el-icon-bicycle' },
      children: [{
        path: '/area',
        name: 'area',
        meta: { title: '区域管理' },
        component: () => import('@/views/Car/area/index.vue')
      },
      {
        path: '/monthCard',
        name: 'monthCard',
        meta: { title: '月卡管理' },
        component: () => import('@/views/Car/monthCard/index.vue')
      },
      {
        path: '/stopCar',
        name: 'stopCar',
        meta: { title: '停车缴费管理' },
        component: () => import('@/views/Car/stopCar/index.vue')
      },
      {
        path: '/charging',
        name: 'charging',
        meta: { title: '计费规则管理' },
        component: () => import('@/views/Car/charging/index.vue')
      }
      ]
    },
    {
      path: '/property',
      component: Layout,
      name: 'property',
      meta: { title: '物业费管理', icon: 'el-icon-wallet' }
    },
    {
      path: '/IntegratedPole',
      component: Layout,
      name: 'IntegratedPole',
      meta: { title: '一体杆管理', icon: 'el-icon-wind-power' },
      children: [{
        path: '/IntegratedPole1',
        name: 'IntegratedPole1',
        meta: { title: '一体杆管理' },
        component: () => import('@/views/IntegratedPole/IntegratedPole1/index')
      },
      {
        path: '/warning',
        name: 'warning',
        meta: { title: '告警记录' },
        component: () => import('@/views/IntegratedPole/warning/index')
      }]
    },
    {
      path: '/system',
      component: Layout,
      name: 'system',
      meta: { title: '系统管理', icon: 'el-icon-chat-round' },
      children: [{
        path: '/employee',
        name: 'employee',
        meta: { title: '员工管理' },
        component: () => import('@/views/system/employee/index')
      },
      {
        path: '/role',
        name: 'role',
        meta: { title: '角色管理' },
        component: () => import('@/views/system/role/index')
      }]
    },
    {
      path: '/404',
      component: () => import('@/views/404'),
      hidden: true
    }
  ]
})

export default router
